package com.shangdiao.sd_server.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shangdiao.sd_server.dao.mybatis.SdCompanyBaseMapper;
import com.shangdiao.sd_server.dao.mybatis.SdCompanyMapper;
import com.shangdiao.sd_server.dao.mybatis.SdCompanyPhotoMapper;
import com.shangdiao.sd_server.dao.mybatis.SdFeedbackMapper;
import com.shangdiao.sd_server.generator.pojo.SdCompany;
import com.shangdiao.sd_server.generator.pojo.SdCompanyBase;
import com.shangdiao.sd_server.generator.pojo.SdCompanyBaseExample;
import com.shangdiao.sd_server.generator.pojo.SdCompanyExample;
import com.shangdiao.sd_server.generator.pojo.SdCompanyPhoto;
import com.shangdiao.sd_server.generator.pojo.SdCompanyPhotoExample;
import com.shangdiao.sd_server.generator.pojo.SdFeedback;
import com.shangdiao.sd_server.service.CompanyService;

@Service(value = "companyService")
public class CompanyServiceImpl implements CompanyService {
	
    @Autowired
    SdCompanyBaseMapper companyBaseMapper;
    
    @Autowired
    SdCompanyMapper companyMapper;
    
    @Autowired
    SdCompanyPhotoMapper companyPhotoMapper;
    
    @Autowired
    SdFeedbackMapper feedbackMapper;

    @Override
    public int countCompanyBaseByExample(SdCompanyBaseExample example) {
    	return companyBaseMapper.countByExample(example);
    }

	@Override
	public int insertCompanyBase(SdCompanyBase companyBase) {
		return companyBaseMapper.insertSelective(companyBase);
		
	}

	@Override
	public int insertCompany(SdCompany company) {
		return companyMapper.insertSelective(company);
	}

	@Override
	public List<SdCompanyBase> selectCompanyBaseByExample(SdCompanyBaseExample example) {
		return companyBaseMapper.selectByExample(example);
	}

	@Override
	public SdCompanyBase selectCompanyBaseById(Integer companyId) {
		return companyBaseMapper.selectByPrimaryKey(companyId);
	}

	@Override
	public SdCompany selectCompanyById(Integer companyId) {
		return companyMapper.selectByPrimaryKey(companyId);
	}

	@Override
	public int updateCompanyById(SdCompany company) {
		return companyMapper.updateByPrimaryKeySelective(company);
	}

	@Override
	public int updateCompanyBaseById(SdCompanyBase companyBase) {
		return companyBaseMapper.updateByPrimaryKeySelective(companyBase);
	}

	@Override
	public int insertCompanyPhoto(SdCompanyPhoto companyPhoto) {
		return companyPhotoMapper.insertSelective(companyPhoto);
	}

	@Override
	public List<SdCompanyPhoto> selectCompanyPhoto(SdCompanyPhotoExample example) {
		return companyPhotoMapper.selectByExample(example);
	}

	@Override
	public List<SdCompany> selectCompanyByExample(SdCompanyExample example) {
		return companyMapper.selectByExample(example);
	}

	@Override
	public int countCompanyByExample(SdCompanyExample example) {
		return companyMapper.countByExample(example);
	}

	@Override
	public int insertFeedback(SdFeedback feedback) {
		return feedbackMapper.insertSelective(feedback);
	}

	@Override
	public int updateCompanyPhoto(SdCompanyPhoto companyPhoto, SdCompanyPhotoExample companyPhotoExample) {
		return companyPhotoMapper.updateByExampleSelective(companyPhoto, companyPhotoExample);
	}

	@Override
	public int updateCompanyPhoto(SdCompanyPhoto companyPhoto) {
		return companyPhotoMapper.updateByPrimaryKeySelective(companyPhoto);
	}


    

    
    

}
